Laura Lemay's Web Workshop: ActiveX and VBScript
FIRST EDITION
Copyright © 1997 by Sams.net Publishing
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. For information, address Sams.net Publishing, 201 W. 103rd St., Indianapolis, IN 46290.
International Standard Book Number: 1-57521-207-2
HTML conversion by :
M/s. LeafWriters (India) Pvt. Ltd.
Website : http://leaf.stpn.soft.net
e-mail :
leafwriters@leaf.stpn.soft.net
Publisher and President: | Richard K. Swadley |
Publishing Manager: | Mark Taber |
Director of Editorial Services: | Cindy Morrow |
Assistant Marketing Managers: | Kristina Perry, Rachel Wolfe |
Acquisitions Editor | David B. Mayhew | Development Editors | Scott D. Meyers, Fran Hatton |
Software Development Specialist | Bob Correll | Production Editor | Ryan Rader |
Copy Editor | Kris Simmons | Indexers | Christine Nelsen, Erika Millen |
Technical Reviewer | Blake B. Hall, Benet Systems | Editorial Coordinator | Katie Wise |
Technical Edit Coordinator | Lorraine Schaffer | Editorial Assistants | Carol Ackerman, Andi Richter, Rhonda Tinch-Mize |
Cover Designer | Alyssa Yesh | Book Designer | Alyssa Yesh |
Copy Writer | Peter Fuller | Production Team Supervisors | Brad Chinn, Charlotte Clapp |
Production | Stephen Adams, Carol Bowers, Kevin Cliburn, Wil Cruz, Cyndi Davis, Jason Hand, Oliver Jackson, Carl Pierce, Dana Rhodes, Erich Richter, Marvin Van Tiem |
I would like to thank a number of people who have made my first project for Sams.net such an enjoyable experience. First of all, David Mayhew, who has had to put up with my many rambling e-mails, and who has done a brilliant job of keeping me on track. Also, Mark Taber, to whom I am thankful for having faith in me, and Fran Hatton and Ryan Rader, for their expert eagle eyes. Thanks go to Rogers Cadenhead for his work on Chapters 12, 15, and 21; to Dick Oliver for the use of his very useful HTML appendix; and, especially, to Laura Lemay for setting the standard to which we aspire.
I would also like to thank the VBScript team at Microsoft for producing another outstanding product. My thanks go to Andy Kington for his excellent Web resource on cookies (http://www.illuminatus.com/cookie), which provided much of the inspiration for Chapter 19. Also, I'd like to acknowledge the work of Dave Paris, Aries Solis, and Melvyn Myers, whose Perl script credit-card checker was ported to VBScript for the example in Chapter 11.
Thanks go to my co-directors in Mentorweb, Rick Armstrong and Alan Ashby, who persevered with my long periods of apparent inactivity while I was writing this book. Also, thanks to all our friends in Bahrain, for their help, support, friendship, and love. The past year was not an easy one for many of us, for many different reasons, but a special bond between us helped us through. We miss you all.
A big thanks to my in-laws, Mavis and Frank, for taking Deb and the kids off my hands for several months over the summer. Bahrain was never so quiet!
A special thanks to Mum and Dad for always allowing me to be me, and for giving me the confidence that can only come from unquestioning support and encouragement.
Above all to Deb, Russel, and Victoria, my motivation and strength.
Paul Lomax is Technical Director of Mentorweb (http://www.mentorweb.net/), a leading Web design and hosting company. He has been a programmer for more than 12 years and has been a dedicated fan of Visual Basic since version 1-back in the days of DOS.
Paul has written systems for financial derivatives forecasting, satellite TV broadcasting, and the life insurance industry, and he has written a major materials tracking system for the oil and gas industry. He has worked for clients in the UK, Germany, Holland, Denmark, Saudi Arabia, and Bahrain. He is also responsible for the concept, design, and programming of the successful "Contact" series of national business databases.
Paul and his family-wife Deborah, and children Russel and Victoria-have recently returned to their home in England after three years of living in the Arabian Gulf.
Over the past two years, Paul has created and maintained over 60 commercial Web sites for Mentorweb's clients. Paul has also created a Web resource dedicated to VBScript, which can be found at http://www.vbscripts.com/.
Rogers Cadenhead (rcade@airmail.net and http://www.cruel.com/rcade) is a Web developer, computer programmer, and writer, who created the multiuser games Czarlords and Super Video Poker. Thousands of readers see his work in the Fort Worth Star-Telegram question-and-answer column "Ask Ed Brice." Rogers has developed Java applets for Tele-Communications Inc. and other clients, is the co-author of Teach Yourself SunSoft's Java Workshop in 21 Days, and contributed to Java Unleashed, 2nd Edition.
As a reader, you are the most important critic and commentator of our books. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way. You can help us make strong books that meet your needs and give you the computer guidance you require.
Do you have access to CompuServe or the World Wide Web? Then check out our CompuServe forum by typing GO SAMS at any prompt. If you prefer the World Wide Web, check out our site at http://www.mcp.com.
Note |
If you have a technical question about this book, call the technical support line at (800) 571-5840, ext. 3668. |
As the publishing manager of the group that created this book,
I welcome your comments. You can fax, e-mail, or write me directly
to let me know what you did or didn't like about this book-as
well as what we can do to make our books stronger. Here's the
information:
Fax: | 317/581-4669 |
E-mail: | newtech_mgr@sams.mcp.com |
Mail: | Mark Taber
Sams.net Publishing 201 W. 103rd Street Indianapolis, IN 46290 |
by Paul Lomax
The Web is the single most important communication development since man first daubed the image of tomorrow's lunch on the wall of his cave. The opportunity is available to all of us to produce the very medium itself, to communicate our ideas and concepts to the rest of the planet literally within minutes of the concept forming in our brain. For the first time, a virtual world within a world has been created-one in which time races by and information distribution times are counted in seconds rather than days. For the first time, businesses have a flexible and instantly updateable medium, which they can use to communicate with potential customers, current customers, employees, shareholders, and the rest of us.
When Microsoft executives realized that they where in danger of missing out on the opportunity that the Internet and the World Wide Web had to offer (and, even worse, that a potential threat to the Windows platform was looming on the horizon), the virtual world as we know it was to change forever.
Microsoft's vision, and its strategy to become a serious contender in the Internet stakes, was to turn the Internet into an extension of the pc desktop. But the comparatively rudimentary interface offered by the Web meant that a huge gulf existed between the Web page and the Windows desktop. If the vision was to be realized, a revolution needed to take place-and fast.
What followed was an unprecedented frenzy of software development activity. Product after product was rolled out via the Web as beta copies, development followed development, and the "Internet year" was shrunk to the point where just a few days off the Web could leave you feeling like you'd just missed the boat.
The result of all this feverish activity is indeed a revolution. In a few short months, the face of the Web has been transformed to the point at which it is now possible to create applications held within a humble Web page that feel, act, and for all intents and purposes are Windows applications.
At the heart of the revolution is the technology known as ActiveX. The reason that the technological revolution on the Web has been achieved with such speed (apart from the instantaneous distribution the Web affords) is that ActiveX is not really new. It is actually an extension of the technology that makes up nearly all Windows programs in use today-the building blocks used by programmers to construct Windows (and now Web) applications. However, ActiveX controls and components need a glue to hold them together. Therefore, a programming language is needed that is easy to learn and use, safe to transmit across the Web, and able to interface with existing HTML controls.
VBScript is the glue that holds the ActiveX controls together and allows controls to interact and interface with each other and the outside world. Again, VBScript leverages several years of tried, tested, and trusted technology in the shape of Visual Basic, a language used by millions of programmers across the world.
ActiveX and VBScript are the foundation for future development of Web and intranet applications. Therefore, it is important that you understand the technologies involved and how they are implemented. But ActiveX and VBScript are not the only means of creating interactive content within Web pages, so why should you put the time and effort into learning how to implement ActiveX and the VBScript language, rather than say Java applets and JavaScript? Here are some reasons:
There is a growing need for more interactivity within Web pages, a need to produce Web sites that are easy to navigate through and easy to use-in short, a need to go beyond what HTML has to offer. Furthermore, within the Web you have a great deal of competition. As a Webmaster, you must find ways to set your site apart from the rest, giving people a reason to visit your site and keep coming back for more. Using ActiveX and VBScript-collectively known as Active Content-is the way to achieve new, exciting, and intuitive Web sites. These Web sites capture an audience's imagination; users enjoy visiting them and find them easy to use. Such sites and applications perform more like Windows applications than like HTML Web pages.
Whether your background is in Web page authoring or application development, you can't afford to be left behind as the two specialties merge into one. Take the opportunity now to learn how to produce Active Content Web sites using ActiveX and VBScript. You'll find it rewarding and, above all, great fun.
The following examples show how this book's Tips, Notes, and Cautions help guide you through the information you will need to know.
Tip |
Tips offer important (or at least interesting) hints and suggestions related to the topic at hand. |
Note |
Notes provide you with interesting, added information about the subject at hand. |
Caution |
Cautions prompt you with gentle warnings to help you stay out of trouble. |